/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

/**
 *
 * @author Gilberto
 */
@Entity
@Table(name = "ecf_estoque")
@NamedQueries({
    @NamedQuery(name = "Estoque.findAll", query = "SELECT e FROM Estoque e")})
public class Estoque implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "NUMERO_SERIE_ECF")
    private String numeroSerieEcf;
    @Column(name = "DATA_ATUALIZACAO")
    @Temporal(TemporalType.DATE)
    private Date dataAtualizacao;
    @Column(name = "HORA_ATUALIZACAO")
    private String horaAtualizacao;
    @Column(name = "HASH_TRIPA")
    private String hashTripa;
    @Column(name = "HASH_INCREMENTO")
    private Integer hashIncremento;
    @JoinColumn(name = "ID_ECF_EMPRESA", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Empresa idEcfEmpresa = new Empresa();
    @JoinColumn(name = "ID_ECF_IMPRESSORA", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Impressora idEcfImpressora = new Impressora();

    public Estoque() {
    }

    public Estoque(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNumeroSerieEcf() {
        return numeroSerieEcf;
    }

    public void setNumeroSerieEcf(String numeroSerieEcf) {
        this.numeroSerieEcf = numeroSerieEcf;
    }

    public Date getDataAtualizacao() {
        return dataAtualizacao;
    }

    public void setDataAtualizacao(Date dataAtualizacao) {
        this.dataAtualizacao = dataAtualizacao;
    }

    public String getHoraAtualizacao() {
        return horaAtualizacao;
    }

    public void setHoraAtualizacao(String horaAtualizacao) {
        this.horaAtualizacao = horaAtualizacao;
    }

    public String getHashTripa() {
        return hashTripa;
    }

    public void setHashTripa(String hashTripa) {
        this.hashTripa = hashTripa;
    }

    public Integer getHashIncremento() {
        return hashIncremento;
    }

    public void setHashIncremento(Integer hashIncremento) {
        this.hashIncremento = hashIncremento;
    }

    public Empresa getIdEcfEmpresa() {
        return idEcfEmpresa;
    }

    public void setIdEcfEmpresa(Empresa idEcfEmpresa) {
        this.idEcfEmpresa = idEcfEmpresa;
    }

    public Impressora getIdEcfImpressora() {
        return idEcfImpressora;
    }

    public void setIdEcfImpressora(Impressora idEcfImpressora) {
        this.idEcfImpressora = idEcfImpressora;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Estoque)) {
            return false;
        }
        Estoque other = (Estoque) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.classes.Estoque[ id=" + id + " ]";
    }
    
}
